package com.treasure.mall.biz.entity.wxtemplate;

import com.treasure.mall.biz.entity.BasePO;
import com.treasure.mall.biz.entity.user.UserPO;
import com.treasure.mall.zbq.common.ienum.wx.TemplateMessageType;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;

/**
 * 
 * <p> 订阅用户表
 * +---------------------------------------------------------
 * * @package: com.treasure.mall.biz.entity.wxtemplate
 * * @author: guomw (guomwchen@foxmail.com)
 * * @date: 2020/8/4 9:34 上午
 * * @since: V1.0.0
 * +---------------------------------------------------------
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 *
 */
@Entity
@Table(name = "zb_subscribe_user")
@Setter
@Getter
public class SubscribeUserPO extends BasePO {

    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    /**
     * 订阅用户
     */
    @ManyToOne
    @JoinColumn(name = "ref_user_id", foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT))
    private UserPO subscribeUser;

    /**
     * 模板类型{@link com.treasure.mall.zbq.common.ienum.wx.TemplateMessageType}
     */
    @Column(name = "template_message_type")
    private TemplateMessageType templateMessageType;

    /**
     * 订阅的消息模板ID
     */
    @Column(name = "temp_id", length = 100)
    private String tempId;


    /**
     * 订阅用户的微信小程序openId
     */
    @Column(name = "subscribe_open_id", length = 50)
    private String subscribeOpenId;


}

